<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户注册</title>
    <style>
        /* 相同样式保持与login.html一致 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', sans-serif;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: #f0f2f5;
        }

        .container {
            background: #fff;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            width: 400px;
        }

        h2 {
            text-align: center;
            margin-bottom: 30px;
            color: #333;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            color: #666;
        }

        input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 16px;
        }

        input:focus {
            outline: none;
            border-color: #007bff;
            box-shadow: 0 0 5px rgba(0,123,255,0.3);
        }

        button {
            width: 100%;
            padding: 12px;
            background: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background 0.3s;
        }

        button:hover {
            background: #0056b3;
        }

        .toggle-form {
            text-align: center;
            margin-top: 20px;
        }

        .toggle-form a {
            color: #007bff;
            text-decoration: none;
            cursor: pointer;
        }

        .toggle-form a:hover {
            text-decoration: underline;
        }

        @media (max-width: 480px) {
            .container {
                width: 90%;
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <form id="registerForm" action="/register/" method="post">
            {% csrf_token %}
            <h2>用户注册</h2>
            <div class="form-group">
                <label>用户名</label>
                <input type="text" required autocomplete="username" name="username">
            </div>
            <div class="form-group">
                <label>邮箱</label>
                <input type="email" required autocomplete="email" name="email">
            </div>
            <div class="form-group">
                <label>密码</label>
                <input type="password" required autocomplete="new-password" name="password">
            </div>
            <div class="form-group">
                <label>确认密码</label>
                <input type="password" required autocomplete="new-password" name="password2">
            </div>
            <button type="submit">注册</button>
            <div class="toggle-form">
                <a href="{% url 'app:login'%}">已有账号？ 立即登录</a>
            </div>
        </form>
    </div>

    <script>
<!--       -->

    </script>
</body>
</html>